package com.levi.listener;

import lombok.extern.slf4j.Slf4j;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;

/**
 * 该消费者过于简单，方法没有返回值，不能实现消息可靠消费
 */
@RocketMQMessageListener(topic = "springboot-rocketmq", consumerGroup = "${rocketmq.consumer.group}")
@Slf4j
@Component
public class MQListener implements RocketMQListener<String> {

    @Override
    public void onMessage(String message) {
        log.info("接收到消息: " + message);
    }
}
